﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Simple.Common.Data;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.ComponentModel;

namespace Simple.ViewModel
{
    public class DataDictionaryDto : Dto<long>
    {
        [Required(ErrorMessage="字典名称不能为空")]
        [StringLength(50, ErrorMessage = "最大长度50")]
        public string Title { get; set; }
        [Required(ErrorMessage = "字典值不能为空")]
        [StringLength(50, ErrorMessage = "最大长度50")]
        public string Code { get; set; }
        /// <summary>
        /// 父ID
        /// </summary>
        [Required(ErrorMessage="请选择字典类型")]
        public long ParentId { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        [Required]
        [RegularExpression("^[0-9]*$")]
        public int Sort { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsActive
        {
            get;
            set;
        }

        public IList<SelectListItem> ParentDictionaryList { get; set; }
    }
}
